import Vue from 'vue';
import {router} from './router/index';
import store from './store';
import App from './app.vue';

// iviewui
import ViewUI from 'view-design';
Vue.use(ViewUI);
import '@/theme/default.less';
//import 'view-design/dist/styles/iview.css';

// 引入全局注册组件
import globalComponent from '@/components/common/index.js'
Vue.use(globalComponent)

// 请求
import $request from './api/request.js';
Vue.prototype.$ajax = $request;

// echarts
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts;


new Vue({
    el: '#app',
    router: router,
    store: store,
    render: h => h(App),
    mounted () {
        // 设置需要缓存的路由
        this.$store.commit('initCachePage');
        // 更新路由菜单
        this.$store.commit('updateMenulist')
    }
});
